﻿
-- 转正审批记录
CREATE proc [dbo].[proc_Employee_ProbationPassed_GetAuditRecord]
(
	@id int
)
as
	select 
		EE.Id,
		(select Enumber from Employee E where EE.EId=E.Id) as Enumber,
		(select ETempNumber from Employee E where EE.EId=E.Id) as ETempNumber,
		EE.EId,
		(select EName from Employee E where EE.EId=E.Id) as EName,
		(select IDCard from Employee E where EE.EId=E.Id) as IDCard,
		(select CompanyName from Company where id=(select companyid from employee E where EE.EId=E.Id)) as CompanyName,
		(select DName from Department where id=(select departmentid from employee E where EE.EId=E.Id)) as DName,
		(select PostName from Post P where id=(select PostId from employee E where EE.EId=E.Id)) as PostName,
		(select Title from Grade G where id=(select GradeId from employee E where EE.EId=E.Id)) as GradeName,
		(select Pluralist from Employee E where EE.EId=E.Id) as Pluralist,
		(select RuzhiDate from Employee E where EE.EId=E.Id) as RuzhiDate,
		EE.ZzDate,
		EE.ProbationFrom,
		EE.ProbationTo,
		EE.Belatefor,
		EE.EarlyOut,
		EE.AskForLeave,
		EE.Absenteeism,
		EE.Performance,
		EE.Audit,
		EE. AuditPerson,
		(select EName from Employee E where EE.AuditPerson=E.UserName) as AuditPersonName,
		EE.AuditTime,
		EE.Memo,
		(SELECT E.XZJB from Employee E where EId=E.Id) as XZJB
	from employee_ProbationPassed EE
	where id = @id
